import request from '@/utils/request'
const BASE_URL = '/apis'

export function getClusterList(params) {
  return request({
    url: BASE_URL + '/clusters',
    method: 'get',
    params
  })
}

export function createCluster(data) {
  return request({
    url: BASE_URL + '/clusters/register',
    method: 'post',
    data: data
  })
}

export function deleteCluster(param) {
  return request({
    url: BASE_URL + '/clusters/' + param,
    method: 'delete'
  })
}

export function getClusterNodes(param) {
  return request({
    url: BASE_URL + '/clusters/' + param + '/resources',
    method: 'get'
  })
}

export function getNodeReboot(param) {
  return request({
    url: BASE_URL + '/analysis/node_reboot/' + param,
    method: 'get'
  })
}

export function getNodeContainer(param) {
  return request({
    url: BASE_URL + '/containers/' + param,
    method: 'get'
  })
}

export function getZombiesContainer(param) {
  return request({
    url: BASE_URL + '/containers/' + param,
    method: 'get'
  })
}

export function getContainerNodeList(param) {
  return request({
    url: BASE_URL + '/containers/' + param,
    method: 'get'
  })
}
